Skip to content

Conversation

@rolandwalker
Copy link
Contributor

Description

  • Rename parameter orig_text and don't overwrite text.
  • Limit regex fuzzy match to 3-character intervening spans for performance and readability of results.
  • Add underscore-split match. If the underscore-split words in the text are a subset of the underscore-split words in the completion item, we have a match.
  • Add CamelCase-split match. If the CamelCase-split words in the text are a subset of the CamelCase-split words in the completion item, we have a match.
  • Remove unused length and position values from tuples, letting "completions" be just a list of strings.

The words within the underscore and camel-split matches are not themselves fuzzy, and must be exact matches. It might be neat if we accepted leading substrings from all of the words instead.

Beyond that, if we need anything more fancy we should use a library rather than rolling our own.

This may close some open issues.

Will cause a merge conflict with #1448, to be resolved later.

Like #1448, the inspiration is to improve completions after adding more possible matches in #1447.

Example showing underscore-split match:
last image

Checklist

  • I've added this contribution to the changelog.md.
  • I've added my name to the AUTHORS file (or it's already there).
  • I ran uv run ruff check && uv run ruff format && uv run mypy --install-types . to lint and format the code.

 * Rename parameter "orig_text" and don't overwrite "text".
 * Limit regex fuzzy match to 3-character intervening spans for
   performance and readability of results.
 * Add underscore-split match.  If the underscore-split words in the
   text are a subset of the underscore-split words in the completion
   item, we have a match.
 * Add CamelCase-split match.  If the CamelCase-split words in the
   text are a subset of the CamelCase-split words in the completion
   item, we have a match.
 * Remove unused length and position values from tuples, letting
   "completions" be just a list of strings.

The words within the underscore and camel-split matches are not
themselves fuzzy, and must be exact matches.  It might be neat if we
accepted leading substrings from all of the words instead.

Beyond that, if we need anything more fancy we should use a library
rather than rolling our own.
@rolandwalker rolandwalker self-assigned this Jan 19, 2026
@scottnemes
Copy link
Contributor

scottnemes commented Jan 19, 2026

RE: the split match functionality, I am comparing it to main and it seems to work the same as far as I can tell. Is there another case that highlights the expected difference?

image image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants